package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id        uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	Mobile    string         `gorm:"column:mobile;type:char(11);not null;" json:"mobile"`
	Username  string         `gorm:"column:username;type:varchar(20);not null;" json:"username"`
	Desc      string         `gorm:"column:desc;type:varchar(50);not null;" json:"desc"`
	Address   string         `gorm:"column:address;type:varchar(255);not null;" json:"address"`
	Img       string         `gorm:"column:img;type:varchar(255);default:NULL;" json:"img"`
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(6);not null;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(6);not null;" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(6);default:NULL;" json:"deleted_at"`
}

func (u *User) TableName() string {
	return "user"
}
